{
LANG : PASCAL
PROB : frac1
}
program FRAC1;
const
  fi = 'frac1.in';
  fo = 'frac1.out';
  max = 10000;
type
  ps = record
         t, m : byte;
       end;
var
  a : array[1..max] of ps;
  n, l : integer;

function GCD(x, y : longint) : longint;
begin
  if y = 0 then GCD := x
  else GCD := GCD(y, x mod y);
end;

procedure swap(i, j : integer);
var
  temp : ps;
begin
  temp := a[i];
  a[i] := a[j];
  a[j] := temp;
end;

function nhohon(a, b : ps) : boolean;
begin
  nhohon := a.t*b.m < b.t*a.m;
end;

procedure sort(l, r : longint);
var
  i, j : longint;
  k : ps;
begin
  if l >= r then exit;
  i := l;
  j := r;
  k := a[(l+r) div 2];
  repeat
    while nhohon(a[i], k) do inc(i);
    while nhohon(k, a[j]) do dec(j);
    if i <= j then
    begin
      swap(i, j);
      inc(i); dec(j);
    end;
  until i > j;
  sort(i, r); sort(l, j);
end;

procedure process;
var
  tu, mau : integer;
begin
  l := 0;
  for mau := 2 to n do
    for tu := 1 to mau-1 do
      if GCD(tu, mau) = 1 then
      begin
        inc(l);
        a[l].t := tu;
        a[l].m := mau;
      end;
  sort(1, l);
end;

procedure out;
var
  i : integer;
begin
  writeln('0/1');
  for i := 1 to l do writeln(a[i].t, '/', a[i].m);
  writeln('1/1');
end;

begin
  assign(input, fi); reset(input);
  assign(output, fo); rewrite(output);
  read(n);
  process;
  out;
  close(output);
  close(input);
end.
